finp$=""
shell("xxd -r -p "+finp$+" > "+finp$+".bin")

gn$="C-C#D-D#E-F-F#G-G#A-A#B-"

open finp$+".bin" for input as #1
open finp$+".txt" for output as #2
while eof(1)=0
  b0=readbyte(1)
  b1=readbyte(1)
  b2=readbyte(1)

  qv=15-(int(b0/16))
  qn=(b0 mod 16)-4:if qn<0 then:q=0:end if
  qo=7-(int(b2/32))
  qi=(b2 mod 32)+((int(b1/128))/4)
  o$="--------"
  o$=mid$(gn$,1+(qn*2),2)+hex$(qo mod 16)+hex$(int(qi/16))+hex$(qi mod 16)+hex$(qv mod 16)+"--"
  if b0+b1+b2=0 then:o$="--------":end if

  print #2,o$

  wend
close #1
close #2


'-------------------------------------------------------------------------



'
'0x000000 0D 30 00 00 (=16*3)'
'
'?? ?? ??
'vn I? oi   (v=invertvolume?,o=invertoctave*2+?,n=note+4?,i=instrument)
'
'04 00 60 = C-400F--
'14 00 60 = C-400E--
'F4 00 60 = C-4000--
'04 00 00 = C-100F--
'14 00 20 = C-200E--
'24 00 40 = C-300D--
'34 00 60 = C-400C--
'F4 00 E0 = C-8000--
'00 00 00 = --------
'
'vvvvnnnn i....... oooiiiii
'
